package no.uio.inf5750.j2mewsclient;

import javax.microedition.lcdui.Item;

import no.uio.inf5750.wsclient.model.DataElement;
import no.uio.inf5750.wsclient.model.DataValue;


public class Field {
    DataElement dataElement;
    DataValue dataValue;
    String originalValue;
    Item item;

    public static final int UNCHANGED = 0;
    public static final int DIRTY = 1;
    public static final int SAVED = 2;
    public static final int SAVEFAILED = 3;
    int status = 0;

    boolean isNew = false;
    boolean isUpdated = false;

    public DataElement getDataElement() {
        return dataElement;
    }

    public void setDataElement(DataElement dataElement) {
        this.dataElement = dataElement;
    }

    public DataValue getDataValue() {
        return dataValue;
    }

    public void setDataValue(DataValue dataValue) {
        this.dataValue = dataValue;
    }

    public String getOriginalValue() {
        return originalValue;
    }

    public void setOriginalValue(String originalValue) {
        this.originalValue = originalValue;
    }

    public Item getItem() {
        return item;
    }

    public void setItem(Item item) {
        this.item = item;
    }

    public boolean isNew() {
        return isNew;
    }

    public void setNew(boolean isNew) {
        this.isNew = isNew;
    }

    public boolean isUpdated() {
        return isUpdated;
    }

    public void setUpdated(boolean isUpdated) {
        this.isUpdated = isUpdated;
    }

    public int getStatus() {
        return status;
    }

    public void setStatus(int status) {
        this.status = status;
        // TODO: Update item to reflect new status
    }

}
